The present invention relates to random access memory (RAM), and more specifically, to a method for reading data forming a two-dimensional array that is stored in a column direction of a RAM, wherein the RAM has a data accessing direction in a row direction.
A typical method of decoding a product code stored in a dynamic random access memory (DRAM) involves sequentially reading a particular data set from of a plurality of data sets stored in the DRAM to compute a corresponding row syndrome or column syndromes of the particular data set. The data corresponding to the particular data set is read from a range of sequential addresses of the DRAM, and a single pass through the range of addresses is made during the read operation. In this way, a row syndrome or column syndromes corresponding to the particular data set can be computed. However, it should be noted that although data is stored in the DRAM in a row direction, the product code is a two-dimensional array having data sets stored in both row and column directions. Therefore, before computing column syndromes that require data of particular columns of the product code stored in the DRAM, it is necessary to read corresponding data sets from the two-dimensional array in a column direction. An example implementation using a DVD system according to a related art is described in the following for illustration.
Please refer to FIG. 1. FIG. 1 is a diagram of a typical error correction code block (ECC block), which is stored in a DRAM of the DVD system. Data sets stored in a DVD disc are encoded using Reed-Solomon product codes (RS-PC codes), and the encoded data sets are read and stored in the DRAM. As shown in FIG. 1, each ECC block is composed of 208 rows of (182, 172) RS codes and 182 columns of (208, 192) RS codes. One row of a (182, 172) RS code occupies 182 bytes, and one column of an (208, 192) RS code occupies 208 bytes. However, because each row of the DRAM has a capacity of 512 bytes, when the ECC block shown in FIG. 1 is stored in the DRAM, multiple rows of the ECC block are stored in each row of the DRAM. Furthermore, due to the difference in row sizes between the ECC block and the DRAM, the columns of the ECC block shown in FIG. 1 do not line up when stored in the DRAM.
Please refer to FIG. 2. FIG. 2 is a flowchart describing operations of decoding a product code from an ECC block being stored in a DRAM. The product code is computed by firstly reading a data set from the DRAM. The data corresponding to the data set is read from a range of sequential addresses of the DRAM, and a single pass through the range of addresses is made during the read operation. Then, corresponding column syndromes are computed according to the related art. More specifically, the flowchart shown in FIG. 2 contains the following steps:
Step 100: Start a product code decoding operation.
Step 102: Read a data set of the ECC block from the DRAM.
Step 104: Compute column syndromes corresponding to the data set.
Step 106: Decode the product code according to the computed column syndromes for the data set.
Step 108: End.
Using the above method, when reading a data set being stored in a column direction of the EEC block in a single read operation, the entire ECC block will need to be read. For example, as shown in FIG. 1, one data set in a column direction contains two columns of (208, 192) RS codes. That is, bytes B0,0, B1,0, B2,0, . . . B207,0 form a first column of (208, 192) RS code, and bytes B0,1, B1,1, B2,1, . . . B207,1 form a second column of (208, 192) RS code. In the ECC block, from the first row to the last row, two bytes in each row are sequentially read. That is, bytes [B0,0, B0,1], [B1,0, B1,1], [B2,0, B2,1] . . . [B207,0, B207,1] are sequentially read and are stored in a static random access memory (SRAM). In this way, the first and second columns of (208, 192) RS codes are completely read. In this example, the width of the data set is one word (1 word=2 bytes). Therefore, each time a data set in the ECC block is read from the DRAM, the number of row changes experienced in the DRAM is 74. (
            208      /              (                  512          182                )              =    74    ,wherein 512 is the number of bytes in a row of the DRAM, 182 is the number of bytes in a row of an ECC block, and 208 is the number of rows of an ECC block.) Therefore, to read all the data sets in the ECC block stored in the DRAM, 6734 row changes of the DRAM are required. (
                    ⌈                  182          2                ⌉            ×      74        =    6734    ,wherein 182 is the number of RS columns, 2 is the number of RS columns in a data set, and 74 is the number of row changes experienced in the DRAM for each data set.) In the above-mentioned step 104, the number of the column syndromes is two, and the two column syndromes respectively correspond to two (208, 192) RS codes.